package vip.web3.common.utils;



import java.io.IOException;
import java.util.Base64;

public class Base64Utils {

    final Base64.Decoder decoder = Base64.getDecoder();
    final Base64.Encoder encoder = Base64.getEncoder();

    /**
     * Base64字符串转 二进制流
     *
     * @param base64String Base64
     * @return base64String
     * @throws IOException 异常
     */
    public static byte[] getStringImage(String base64String) {

        Base64.Decoder decoder = Base64.getDecoder();
        try {
            return base64String != null ? decoder.decode(base64String.split(",")[1]) : null;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}
